package com.gyms.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.gyms.R;

import java.util.List;

/**
 * ltx on 2016/11/7 09:46
 * 搜索的历史记录Adapter
 */
public class HistoryAdapter extends BaseAdapter {
    private List<String> mHistroyList;
    private Context mContext;
    private LayoutInflater mInflater;
    public HistoryAdapter(Context mContext){
        this.mContext=mContext;
        mInflater= LayoutInflater.from(mContext);
    }
    public void setHistroyList(List<String> histroyList) {
        mHistroyList = histroyList;
    }
    @Override
    public int getCount() {
//        return mHistroyList==null?0:mHistroyList.size();
        return 3;
    }

    @Override
    public Object getItem(int position) {
        return mHistroyList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if(null==convertView){
            convertView=mInflater.inflate(R.layout.history_item,null,false);
        }else{

        }
        return convertView;
    }


}
